package com.example.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
/*
 * 李洲 2020030654A1213
 * 2024.05.24
 */
@Controller
@RequestMapping("/example")
public class ForwardController {

    // 处理初始请求，并转发到 "/forwarded"
    @GetMapping("/forward")
    public String forward() {
        return "forward:/example/forwarded";
    }

    // 处理转发后的请求
    @GetMapping("/forwarded")
    public String forwarded() {
        return "forwarded"; // 对应视图的名称
    }
}
